<!DOCTYPE html>
<html lang="en" >
<head>
    <title>Atomsk - Tools - Pierre Hirel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
    <link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>
   
<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Companion tools</h2>

<p>The folder <code>/tools/</code> provided in the Atomsk package contains some scripts that can be used to make simple transformations on some files. When <a href="./install.html">installing Atomsk</a> (either with the script "install.sh", or with the command "<code>make install</code>"), these scripts are made executable and copied in the <em>/usr/local/bin</em> folder. Running any of these scripts without any argument will display its usage.</p>

<p>As the rest of the code, these bash scripts are provided as-is and without any warranty. I suggest that you edit them to check what they do and/or adapt them to your needs.</p>


<hr>
<h4>cfg_setA.sh</h4>

<p>This bash script sets the scaling factor A to a given &#60;value&#62; in <a href="./format_cfg.html">Atomeye configuration files (*.cfg)</a>. This script can be useful if Atomeye refuses to display a configuration and displays the error message "<code>ATOM_COORDINATION_MAX = 24 exceeded</code>". For instance, to set A=1.3 in the file "myfile.cfg" just type:</p>

<p><code class="command">cfg_setA.sh 1.3 myfile.cfg</code></p>

<p>If many file names are specified, they will all be treated.</p>


<hr>
<h4>dat_mulvec.sh</h4>

<p>This bash script reads a data file (*.dat) containing at least six columns of real numbers, assuming they are the positions of atoms followed by some vector (X Y Z vx vy vz), and multiplies all the vectors by the given &#60;factor&#62;. In order to convert the file "myfile.dat" just type:</p>

<p class="command"><code>dat_mulvec.sh &#60;factor&#62; myfile.dat</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file.</p>


<hr>
<h4>dat_rm0.sh</h4>

<p>This bash script reads a data file (*.dat) containing at least six columns of real numbers, assuming they are the positions of atoms followed by some vector (X Y Z vx vy vz), and removes all lines where the three last values are zero. In order to process the file "myfile.dat" just type:</p>

<p class="command"><code>dat_rm0.sh myfile.dat</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file.</p>


<hr>
<h4>lmp_atom2charge.sh</h4>

<p>This bash script converts one or several <a href="./format_lmp.html">LAMMPS data files (*.lmp)</a> with the format "<code>ID type x y z</code>" (suited for "<code>atom_style atom</code>") into the format "<code>ID type charge x y z</code>" (suited for "<code>atom_style charge</code>"). In order to convert the file "myfile.lmp" just type:</p>

<p><code class="command">lmp_atom2charge.sh myfile.lmp</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file. Practically, the script copies the first two columns of data, adds zeros in the third column, and copies the last three columns of data.</p>


<hr>
<h4>lmp_charge2atom.sh</h4>

<p>This bash script does the inverse of the one above, i.e. it converts a <a href="./format_lmp.html">LAMMPS data file (*.lmp)</a> from the format "<code>ID type charge x y z</code>" to the format "<code>ID type x y z</code>". Similarly, to convert the file "myfile.lmp" just type:</p>

<p><code class="command">lmp_charge2atom.sh myfile.lmp</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file. Practically, the script copies only the first two and the last three columns of data of the file.</p>


<hr>
<h4>lmp_ortho2tri.sh</h4>

<p>This bash script transforms a <a href="./format_lmp.html">LAMMPS data file (*.lmp)</a> into a triclinic box, i.e. after the line ending with "<code>zhi</code>" it adds a new line containing: "<code>0.0000000    0.00000000    0.00000000  xy xz yz</code>". If a line containing "<code>xy xz yz</code>" already exists then the script doesn't do anything. Like the previous scripts, to convert the file "myfile.lmp" just type:</p>

<p><code class="command">lmp_ortho2tri.sh myfile.lmp</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file.</p>


<hr>
<h4>qepw_bohr.sh</h4>

<p>This bash script sets the lines "<code>CELL PARAMETERS</code>" and "<code>ATOMIC_POSITIONS</code>" to "bohr" in one or several <a href="./format_qepw.html">Quantum Espresso pwscf files (*.pw)</a>. When writing PW files Atomsk does not recognize the units and will always assume "angstroms", this script allows to change that to "bohr". To convert the file "myfile.pw" just type:</p>

<p><code class="command">qepw_bohr.sh myfile.pw</code></p>

<p>Many file names can be specified at once in the same command-line. Beware that this script replaces the file.</p>

<hr>

<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
